const Service = require('../../../core/service/ApiService');

class RecordSvc extends Service {

    //搜索服务记录
    async searchRecord(begin, end, svc_item_id, status) {
        const begin_time = this.helper.YMDhms(begin);
        const end_time = this.helper.YMDhms(end);
        const dao = this.service.admin.svcrecord.dao;
        const amount = await dao.searchAmount(begin_time, end_time, svc_item_id, status);
        return {
            count: amount,
            list: await dao.searchRecord(begin_time, end_time, svc_item_id, status)
        }
    }

    //搜索服务项目列表
    async searchSvcItemList() {
        return {
            svc_item_list: await this.service.admin.svcrecord.dao.searchSvcItemList()
        }
    }

    //服务历史查看详情
    async viewDetail(id) {
        return this.service.admin.svcrecord.dao.viewDetail(id);
    }

    //服务历史详情编辑
    async editDetail(svc_record_id, text_evalu, remark) {
        return this.service.admin.svcrecord.dao.editDetail(svc_record_id, text_evalu, remark)
    }
}

module.exports = RecordSvc;




